<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>GDBM_File - Perl5 access to the gdbm library. - Perldoc Browser</title>
    <link rel="search" href="https://perldoc.perl.org/opensearch.xml" type="application/opensearchdescription+xml" title="Perldoc Browser">
    <link rel="canonical" href="https://perldoc.perl.org/GDBM_File">
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" integrity="sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z" crossorigin="anonymous">
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/10.5.0/styles/stackoverflow-light.min.css" integrity="sha512-cG1IdFxqipi3gqLmksLtuk13C+hBa57a6zpWxMeoY3Q9O6ooFxq50DayCdm0QrDgZjMUn23z/0PMZlgft7Yp5Q==" crossorigin="anonymous" />
    <style>
      body {
        background: #f4f4f5;
        color: #020202;
      }
      .navbar-dark {
        background-image: -webkit-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: -o-linear-gradient(top, #005f85 0, #002e49 100%);
        background-image: linear-gradient(to bottom, #005f85 0, #002e49 100%);
        filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff005f85', endColorstr='#ff002e49', GradientType=0);
        background-repeat: repeat-x;
      }
      .navbar-dark .navbar-nav .nav-link,
      .navbar-dark .navbar-nav .nav-link:focus { color: #fff }
      .navbar-dark .navbar-nav .nav-link:hover { color: #ffef68 }
      #wrapperlicious {
        margin: 0 auto;
        font: 0.9em 'Helvetica Neue', Helvetica, sans-serif;
        font-weight: normal;
        line-height: 1.5em;
        margin: 0;
        padding: 0;
      }
      #wrapperlicious h1 { font-size: 1.5em }
      #wrapperlicious h2 { font-size: 1.3em }
      #wrapperlicious h3 { font-size: 1.1em }
      #wrapperlicious h4 { font-size: 0.9em }
      #wrapperlicious h1, #wrapperlicious h2, #wrapperlicious h3,
      #wrapperlicious h4, #wrapperlicious dt {
        color: #020202;
        margin-top: 1em;
        margin-bottom: 1em;
        position: relative;
        font-weight: bold;
      }
      #wrapperlicious a { color: inherit; text-decoration: underline }
      #wrapperlicious #toc { text-decoration: none }
      #wrapperlicious a:hover { color: #2a2a2a }
      #wrapperlicious a img { border: 0 }
      #wrapperlicious :not(pre) > code {
        color: inherit;
        background-color: rgba(0, 0, 0, 0.04);
        border-radius: 3px;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        padding: 0.3em;
      }
      #wrapperlicious dd {
        margin: 0;
        margin-left: 2em;
      }
      #wrapperlicious dt {
        color: #2a2a2a;
        font-weight: bold;
        margin-left: 0.9em;
      }
      #wrapperlicious p {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious li > p {
        margin-bottom: 0;
        margin-top: 0;
      }
      #wrapperlicious pre {
        border: 1px solid #c1c1c1;
        border-radius: 3px;
        font: 100% Consolas, Menlo, Monaco, monospace;
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious pre > code {
        display: block;
        background-color: #f6f6f6;
        font: 0.9em Consolas, Menlo, Monaco, monospace;
        line-height: 1.5em;
        text-align: left;
        white-space: pre;
        padding: 1em;
      }
      #wrapperlicious dl, #wrapperlicious ol, #wrapperlicious ul {
        margin-bottom: 1em;
        margin-top: 1em;
      }
      #wrapperlicious ul {
        list-style-type: square;
      }
      #wrapperlicious ul ul {
        margin-bottom: 0px;
        margin-top: 0px;
      }
      #footer {
        font-size: 0.8em;
        padding-top: 0.5em;
        text-align: center;
      }
      #more {
        display: inline;
        font-size: 0.8em;
      }
      #perldocdiv {
        background-color: #fff;
        border: 1px solid #c1c1c1;
        border-bottom-left-radius: 5px;
        border-bottom-right-radius: 5px;
        margin-left: auto;
        margin-right: auto;
        padding: 3em;
        padding-top: 1em;
        max-width: 960px;
      }
      #moduleversion { float: right }
      #wrapperlicious .leading-notice {
        font-style: italic;
        padding-left: 1em;
        margin-top: 1em;
        margin-bottom: 1em;
      }
      #wrapperlicious .permalink {
        display: none;
        left: -0.75em;
        position: absolute;
        padding-right: 0.25em;
        text-decoration: none;
      }
      #wrapperlicious h1:hover .permalink, #wrapperlicious h2:hover .permalink,
      #wrapperlicious h3:hover .permalink, #wrapperlicious h4:hover .permalink,
      #wrapperlicious dt:hover .permalink {
        display: block;
      }
    </style>
    <!-- Global site tag (gtag.js) - Google Analytics -->
    <script async src="https://www.googletagmanager.com/gtag/js?id=G-KVNWBNT5FB"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());

      gtag('config', 'G-KVNWBNT5FB');
      gtag('config', 'UA-50555-3');
    </script>
  </head>
  <body>
    <nav class="navbar navbar-expand-md navbar-dark bg-dark justify-content-between">
  <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
    <span class="navbar-toggler-icon"></span>
  </button>
  <a class="navbar-brand" href="https://perldoc.perl.org/">Perldoc Browser</a>
  <div class="collapse navbar-collapse" id="navbarNav">
    <ul class="navbar-nav mr-auto">
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="GDBM_File.html#" id="dropdownlink-stable" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">5.35.0</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-stable">
          <a class="dropdown-item" href="https://perldoc.perl.org/GDBM_File">Latest</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.2/GDBM_File">5.38.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.1/GDBM_File">5.38.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0/GDBM_File">5.38.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.3/GDBM_File">5.36.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.2/GDBM_File">5.36.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.1/GDBM_File">5.36.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.36.0/GDBM_File">5.36.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.3/GDBM_File">5.34.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.2/GDBM_File">5.34.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.1/GDBM_File">5.34.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.34.0/GDBM_File">5.34.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.1/GDBM_File">5.32.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.32.0/GDBM_File">5.32.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.3/GDBM_File">5.30.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.2/GDBM_File">5.30.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.1/GDBM_File">5.30.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.30.0/GDBM_File">5.30.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.3/GDBM_File">5.28.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.2/GDBM_File">5.28.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.1/GDBM_File">5.28.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.28.0/GDBM_File">5.28.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.3/GDBM_File">5.26.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.2/GDBM_File">5.26.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.1/GDBM_File">5.26.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.26.0/GDBM_File">5.26.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.4/GDBM_File">5.24.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.3/GDBM_File">5.24.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.2/GDBM_File">5.24.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.1/GDBM_File">5.24.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.24.0/GDBM_File">5.24.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.4/GDBM_File">5.22.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.3/GDBM_File">5.22.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.2/GDBM_File">5.22.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.1/GDBM_File">5.22.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.22.0/GDBM_File">5.22.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.3/GDBM_File">5.20.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.2/GDBM_File">5.20.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.1/GDBM_File">5.20.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.20.0/GDBM_File">5.20.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.4/GDBM_File">5.18.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.3/GDBM_File">5.18.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.2/GDBM_File">5.18.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.1/GDBM_File">5.18.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.18.0/GDBM_File">5.18.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.3/GDBM_File">5.16.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.2/GDBM_File">5.16.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.1/GDBM_File">5.16.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.16.0/GDBM_File">5.16.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.4/GDBM_File">5.14.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.3/GDBM_File">5.14.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.2/GDBM_File">5.14.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.1/GDBM_File">5.14.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.14.0/GDBM_File">5.14.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.5/GDBM_File">5.12.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.4/GDBM_File">5.12.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.3/GDBM_File">5.12.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.2/GDBM_File">5.12.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.1/GDBM_File">5.12.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.12.0/GDBM_File">5.12.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.1/GDBM_File">5.10.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.10.0/GDBM_File">5.10.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.9/GDBM_File">5.8.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.8/GDBM_File">5.8.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.7/GDBM_File">5.8.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.6/GDBM_File">5.8.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.5/GDBM_File">5.8.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.4/GDBM_File">5.8.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.3/GDBM_File">5.8.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.2/GDBM_File">5.8.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.1/GDBM_File">5.8.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.8.0/GDBM_File">5.8.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.2/GDBM_File">5.6.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.1/GDBM_File">5.6.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.6.0/GDBM_File">5.6.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_04/GDBM_File">5.005_04</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_03/GDBM_File">5.005_03</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_02/GDBM_File">5.005_02</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005_01/GDBM_File">5.005_01</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.005/GDBM_File">5.005</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="GDBM_File.html#" id="dropdownlink-dev" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Dev</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-dev">
          <a class="dropdown-item" href="https://perldoc.perl.org/blead/GDBM_File">blead</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.6/GDBM_File">5.39.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.5/GDBM_File">5.39.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.4/GDBM_File">5.39.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.3/GDBM_File">5.39.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.2/GDBM_File">5.39.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.39.1/GDBM_File">5.39.1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC2/GDBM_File">5.38.0-RC2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.38.0-RC1/GDBM_File">5.38.0-RC1</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.11/GDBM_File">5.37.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.10/GDBM_File">5.37.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.9/GDBM_File">5.37.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.8/GDBM_File">5.37.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.7/GDBM_File">5.37.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.6/GDBM_File">5.37.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.5/GDBM_File">5.37.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.4/GDBM_File">5.37.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.3/GDBM_File">5.37.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.2/GDBM_File">5.37.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.1/GDBM_File">5.37.1</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.37.0/GDBM_File">5.37.0</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.11/GDBM_File">5.35.11</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.10/GDBM_File">5.35.10</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.9/GDBM_File">5.35.9</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.8/GDBM_File">5.35.8</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.7/GDBM_File">5.35.7</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.6/GDBM_File">5.35.6</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.5/GDBM_File">5.35.5</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.4/GDBM_File">5.35.4</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.3/GDBM_File">5.35.3</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.2/GDBM_File">5.35.2</a>
          <a class="dropdown-item" href="https://perldoc.perl.org/5.35.1/GDBM_File">5.35.1</a>
          <a class="dropdown-item active" href="GDBM_File.html">5.35.0</a>
        </div>
      </li>
      <li class="nav-item dropdown text-nowrap">
        <a class="nav-link dropdown-toggle" href="GDBM_File.html#" id="dropdownlink-nav" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Documentation</a>
        <div class="dropdown-menu" aria-labelledby="dropdownlink-nav">
          <a class="dropdown-item" href="perl.html">Perl</a>
          <a class="dropdown-item" href="perlintro.html">Intro</a>
          <a class="dropdown-item" href="perl.html#Tutorials">Tutorials</a>
          <a class="dropdown-item" href="perlfaq.html">FAQs</a>
          <a class="dropdown-item" href="perl.html#Reference-Manual">Reference</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlop.html">Operators</a>
          <a class="dropdown-item" href="functions.html">Functions</a>
          <a class="dropdown-item" href="variables.html">Variables</a>
          <a class="dropdown-item" href="modules.html">Modules</a>
          <a class="dropdown-item" href="perlutil.html">Utilities</a>
          <div class="dropdown-divider"></div>
          <a class="dropdown-item" href="perlcommunity.html">Community</a>
          <a class="dropdown-item" href="perlhist.html">History</a>
        </div>
      </li>
    </ul>
    <ul class="navbar-nav">
      <script>
        function set_expand (expand) {
          var perldocdiv = document.getElementById('perldocdiv');
          var width = window.getComputedStyle(perldocdiv).getPropertyValue('max-width');
          var expanded = (width == '' || width == 'none') ? true : false;
          if (expand === null) {
            expand = !expanded;
          }
          if ((expand && !expanded) || (!expand && expanded)) {
            perldocdiv.style.setProperty('max-width', expand ? 'none' : '960px');
            var button_classlist = document.getElementById('content-expand-button').classList;
            if (expand) {
              button_classlist.add('btn-light');
              button_classlist.remove('btn-outline-light');
            } else {
              button_classlist.add('btn-outline-light');
              button_classlist.remove('btn-light');
            }
          }
          return expand;
        }
        function toggle_expand () {
          var expand = set_expand(null);
          document.cookie = 'perldoc_expand=' + (expand ? 1 : 0) + '; path=/; expires=Tue, 19 Jan 2038 03:14:07 UTC';
        }
        function read_expand () {
          return document.cookie.split(';').some(function (item) { return item.indexOf('perldoc_expand=1') >= 0 });
        }
        if (document.readyState === 'loading') {
          document.addEventListener('DOMContentLoaded', function () {
            if (read_expand()) {
              set_expand(true);
            }
          });
        } else if (read_expand()) {
          set_expand(true);
        }
      </script>
      <button id="content-expand-button" type="button" class="btn btn-outline-light d-none d-lg-inline-block mr-2" onclick="toggle_expand()">Expand</button>
    <ul>
    <form class="form-inline" method="get" action="https://perldoc.perl.org/5.35.0/search">
      <input class="form-control mr-3" type="search" name="q" placeholder="Search" aria-label="Search">
    </form>
  </div>
</nav>

    <div id="wrapperlicious" class="container-fluid">
      <div id="perldocdiv">
        <div id="links">
          <a href="GDBM_File.html">GDBM_File</a>
          <div id="more">
            (<a href="GDBM_File.txt">source</a>,
            <a href="https://metacpan.org/pod/GDBM_File">CPAN</a>)
          </div>
            <div id="moduleversion">version 1.19</div>
        </div>
        <div class="leading-notice">
          You are viewing the version of this documentation from Perl 5.35.0.
            This is a development version of Perl.
        </div>
        <h1><a id="toc">CONTENTS</a></h1>
                  <ul>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#NAME">NAME</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#SYNOPSIS">SYNOPSIS</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#DESCRIPTION">DESCRIPTION</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#STATIC-METHODS">STATIC METHODS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#GDBM_version">GDBM_version</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#METHODS">METHODS</a>
                            <ul>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#close">close</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#errno">errno</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#syserrno">syserrno</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#strerror">strerror</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#clear_error">clear_error</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#needs_recovery">needs_recovery</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#reorganize">reorganize</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#sync">sync</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#count">count</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#flags">flags</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#dbname">dbname</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#cache_size">cache_size</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#block_size">block_size</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#sync_mode">sync_mode</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#centfree">centfree</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#coalesce">coalesce</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#mmap">mmap</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#mmapsize">mmapsize</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#recover">recover</a>
              </li>
          </ul>

              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#AVAILABILITY">AVAILABILITY</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#SECURITY-AND-PORTABILITY">SECURITY AND PORTABILITY</a>
              </li>
              <li>
                <a class="text-decoration-none" href="GDBM_File.html#SEE-ALSO">SEE ALSO</a>
              </li>
          </ul>

      <h1 id="NAME"><a class="permalink" href="GDBM_File.html#NAME">#</a>NAME</h1>

<p>GDBM_File - Perl5 access to the gdbm library.</p>

<h1 id="SYNOPSIS"><a class="permalink" href="GDBM_File.html#SYNOPSIS">#</a>SYNOPSIS</h1>

<pre><code>use GDBM_File;
[$db =] tie %hash, &#39;GDBM_File&#39;, $filename, &amp;GDBM_WRCREAT, 0640;
# Use the %hash array.

$e = $db-&gt;errno;
$e = $db-&gt;syserrno;
$str = $db-&gt;strerror;
$bool = $db-&gt;needs_recovery;

$db-&gt;clear_error;

$db-&gt;reorganize;
$db-&gt;sync;

$n = $db-&gt;count;

$n = $db-&gt;flags;

$str = $db-&gt;dbname;

$db-&gt;cache_size;
$db-&gt;cache_size($newsize);

$n = $db-&gt;block_size;

$bool = $db-&gt;sync_mode;
$db-&gt;sync_mode($bool);

$bool = $db-&gt;centfree;
$db-&gt;centfree($bool);

$bool = $db-&gt;coalesce;
$db-&gt;coalesce($bool);

$bool = $db-&gt;mmap;

$size = $db-&gt;mmapsize;
$db-&gt;mmapsize($newsize);

$db-&gt;recover(%args);

untie %hash ;</code></pre>

<h1 id="DESCRIPTION"><a class="permalink" href="GDBM_File.html#DESCRIPTION">#</a>DESCRIPTION</h1>

<p><b>GDBM_File</b> is a module which allows Perl programs to make use of the facilities provided by the GNU gdbm library. If you intend to use this module you should really have a copy of the gdbm manualpage at hand.</p>

<p>Most of the libgdbm.a functions are available through the GDBM_File interface.</p>

<p>Unlike Perl&#39;s built-in hashes, it is not safe to <code>delete</code> the current item from a GDBM_File tied hash while iterating over it with <code>each</code>. This is a limitation of the gdbm library.</p>

<h1 id="STATIC-METHODS"><a class="permalink" href="GDBM_File.html#STATIC-METHODS">#</a><a id="STATIC"></a>STATIC METHODS</h1>

<h2 id="GDBM_version"><a class="permalink" href="GDBM_File.html#GDBM_version">#</a>GDBM_version</h2>

<pre><code>$str = GDBM_File-&gt;GDBM_version;
@ar = GDBM_File-&gt;GDBM_version;</code></pre>

<p>Returns the version number of the underlying <b>libgdbm</b> library. In scalar context, returns the library version formatted as string:</p>

<pre><code class="plaintext">MINOR.MAJOR[.PATCH][ (GUESS)]</code></pre>

<p>where <i>MINOR</i>, <i>MAJOR</i>, and <i>PATCH</i> are version numbers, and <i>GUESS</i> is a guess level (see below).</p>

<p>In list context, returns a list:</p>

<pre><code class="plaintext">( MINOR, MAJOR, PATCH [, GUESS] )</code></pre>

<p>The <i>GUESS</i> component is present only if <b>libgdbm</b> version is 1.8.3 or earlier. This is because earlier releases of <b>libgdbm</b> did not include information about their version and the <b>GDBM_File</b> module has to implement certain guesswork in order to determine it. <i>GUESS</i> is a textual description in string context, and a positive number indicating how rough the guess is in list context. Possible values are:</p>

<dl>

<dt id="1-exact-guess"><a class="permalink" href="GDBM_File.html#1-exact-guess">#</a><a id="1"></a><a id="exact-guess"></a>1 - exact guess</dt>
<dd>

<p>The major and minor version numbers are guaranteed to be correct. The actual patchlevel is most probably guessed right, but can be 1-2 less than indicated.</p>

</dd>
<dt id="2-approximate"><a class="permalink" href="GDBM_File.html#2-approximate">#</a><a id="2"></a><a id="approximate"></a>2 - approximate</dt>
<dd>

<p>The major and minor number are guaranteed to be correct. The patchlevel is set to the upper bound.</p>

</dd>
<dt id="3-rough-guess"><a class="permalink" href="GDBM_File.html#3-rough-guess">#</a><a id="3"></a><a id="rough-guess"></a>3 - rough guess</dt>
<dd>

<p>The version is guaranteed to be not newer than <b><i>MAJOR</i>.<i>MINOR</i></b>.</p>

</dd>
</dl>

<h1 id="METHODS"><a class="permalink" href="GDBM_File.html#METHODS">#</a>METHODS</h1>

<h2 id="close"><a class="permalink" href="GDBM_File.html#close">#</a>close</h2>

<pre><code>$db-&gt;close;</code></pre>

<p>Closes the database. You are not advised to use this method directly. Please, use <b>untie</b> instead.</p>

<h2 id="errno"><a class="permalink" href="GDBM_File.html#errno">#</a>errno</h2>

<pre><code>$db-&gt;errno</code></pre>

<p>Returns the last error status associated with this database.</p>

<h2 id="syserrno"><a class="permalink" href="GDBM_File.html#syserrno">#</a>syserrno</h2>

<pre><code>$db-&gt;syserrno</code></pre>

<p>Returns the last system error status (C <code>errno</code> variable), associated with this database,</p>

<h2 id="strerror"><a class="permalink" href="GDBM_File.html#strerror">#</a>strerror</h2>

<pre><code>$db-&gt;strerror</code></pre>

<p>Returns textual description of the last error that occurred in this database.</p>

<h2 id="clear_error"><a class="permalink" href="GDBM_File.html#clear_error">#</a>clear_error</h2>

<pre><code>$db-&gt;clear_error</code></pre>

<p>Clear error status.</p>

<h2 id="needs_recovery"><a class="permalink" href="GDBM_File.html#needs_recovery">#</a>needs_recovery</h2>

<pre><code>$db-&gt;needs_recovery</code></pre>

<p>Returns true if the database needs recovery.</p>

<h2 id="reorganize"><a class="permalink" href="GDBM_File.html#reorganize">#</a>reorganize</h2>

<pre><code>$db-&gt;reorganize;</code></pre>

<p>Reorganizes the database.</p>

<h2 id="sync"><a class="permalink" href="GDBM_File.html#sync">#</a>sync</h2>

<pre><code>$db-&gt;sync;</code></pre>

<p>Synchronizes recent changes to the database with its disk copy.</p>

<h2 id="count"><a class="permalink" href="GDBM_File.html#count">#</a>count</h2>

<pre><code>$n = $db-&gt;count;</code></pre>

<p>Returns number of keys in the database.</p>

<h2 id="flags"><a class="permalink" href="GDBM_File.html#flags">#</a>flags</h2>

<pre><code>$db-&gt;flags;</code></pre>

<p>Returns flags passed as 4th argument to <b>tie</b>.</p>

<h2 id="dbname"><a class="permalink" href="GDBM_File.html#dbname">#</a>dbname</h2>

<pre><code>$db-&gt;dbname;</code></pre>

<p>Returns the database name (i.e. 3rd argument to <b>tie</b>.</p>

<h2 id="cache_size"><a class="permalink" href="GDBM_File.html#cache_size">#</a>cache_size</h2>

<pre><code>$db-&gt;cache_size;
$db-&gt;cache_size($newsize);</code></pre>

<p>Returns the size of the internal <b>GDBM</b> cache for that database.</p>

<p>Called with argument, sets the size to <i>$newsize</i>.</p>

<h2 id="block_size"><a class="permalink" href="GDBM_File.html#block_size">#</a>block_size</h2>

<pre><code>$db-&gt;block_size;</code></pre>

<p>Returns the block size of the database.</p>

<h2 id="sync_mode"><a class="permalink" href="GDBM_File.html#sync_mode">#</a>sync_mode</h2>

<pre><code>$db-&gt;sync_mode;
$db-&gt;sync_mode($bool);</code></pre>

<p>Returns the status of the automatic synchronization mode. Called with argument, enables or disables the sync mode, depending on whether $bool is <b>true</b> or <b>false</b>.</p>

<p>When synchronization mode is on (<b>true</b>), any changes to the database are immediately written to the disk. This ensures database consistency in case of any unforeseen errors (e.g. power failures), at the expense of considerable slowdown of operation.</p>

<p>Synchronization mode is off by default.</p>

<h2 id="centfree"><a class="permalink" href="GDBM_File.html#centfree">#</a>centfree</h2>

<pre><code>$db-&gt;centfree;
$db-&gt;centfree($bool);</code></pre>

<p>Returns status of the central free block pool (<b>0</b> - disabled, <b>1</b> - enabled).</p>

<p>With argument, changes its status.</p>

<p>By default, central free block pool is disabled.</p>

<h2 id="coalesce"><a class="permalink" href="GDBM_File.html#coalesce">#</a>coalesce</h2>

<pre><code>$db-&gt;coalesce;
$db-&gt;coalesce($bool);</code></pre>

<h2 id="mmap"><a class="permalink" href="GDBM_File.html#mmap">#</a>mmap</h2>

<pre><code>$db-&gt;mmap;</code></pre>

<p>Returns true if memory mapping is enabled.</p>

<p>This method will <b>croak</b> if the <b>libgdbm</b> library is complied without memory mapping support.</p>

<h2 id="mmapsize"><a class="permalink" href="GDBM_File.html#mmapsize">#</a>mmapsize</h2>

<pre><code>$db-&gt;mmapsize;
$db-&gt;mmapsize($newsize);</code></pre>

<p>If memory mapping is enabled, returns the size of memory mapping. With argument, sets the size to <b>$newsize</b>.</p>

<p>This method will <b>croak</b> if the <b>libgdbm</b> library is complied without memory mapping support.</p>

<h2 id="recover"><a class="permalink" href="GDBM_File.html#recover">#</a>recover</h2>

<pre><code>$db-&gt;recover(%args);</code></pre>

<p>Recovers data from a failed database. <b>%args</b> is optional and can contain following keys:</p>

<dl>

<dt id="err-=&gt;-sub-{-...-}"><a class="permalink" href="GDBM_File.html#err-=%3E-sub-%7B-...-%7D">#</a><a id="err"></a><a id="err-sub"></a>err =&gt; sub { ... }</dt>
<dd>

<p>Reference to code for detailed error reporting. Upon encountering an error, <b>recover</b> will call this sub with a single argument - a description of the error.</p>

</dd>
<dt id="backup-=&gt;-\$str"><a class="permalink" href="GDBM_File.html#backup-=%3E-%5C$str">#</a><a id="backup"></a><a id="backup-str"></a>backup =&gt; \$str</dt>
<dd>

<p>Creates a backup copy of the database before recovery and returns its filename in <b>$str</b>.</p>

</dd>
<dt id="max_failed_keys-=&gt;-$n"><a class="permalink" href="GDBM_File.html#max_failed_keys-=%3E-$n">#</a><a id="max_failed_keys"></a><a id="max_failed_keys-n"></a>max_failed_keys =&gt; $n</dt>
<dd>

<p>Maximum allowed number of failed keys. If the actual number becomes equal to <i>$n</i>, <b>recover</b> aborts and returns error.</p>

</dd>
<dt id="max_failed_buckets-=&gt;-$n"><a class="permalink" href="GDBM_File.html#max_failed_buckets-=%3E-$n">#</a><a id="max_failed_buckets"></a><a id="max_failed_buckets-n"></a>max_failed_buckets =&gt; $n</dt>
<dd>

<p>Maximum allowed number of failed buckets. If the actual number becomes equal to <i>$n</i>, <b>recover</b> aborts and returns error.</p>

</dd>
<dt id="max_failures-=&gt;-$n"><a class="permalink" href="GDBM_File.html#max_failures-=%3E-$n">#</a><a id="max_failures"></a><a id="max_failures-n"></a>max_failures =&gt; $n</dt>
<dd>

<p>Maximum allowed number of failures during recovery.</p>

</dd>
<dt id="stat-=&gt;-\%hash"><a class="permalink" href="GDBM_File.html#stat-=%3E-%5C%25hash">#</a><a id="stat"></a><a id="stat-hash"></a>stat =&gt; \%hash</dt>
<dd>

<p>Return recovery statistics in <i>%hash</i>. Upon return, the following keys will be present:</p>

<dl>

<dt id="recovered_keys"><a class="permalink" href="GDBM_File.html#recovered_keys">#</a>recovered_keys</dt>
<dd>

<p>Number of successfully recovered keys.</p>

</dd>
<dt id="recovered_buckets"><a class="permalink" href="GDBM_File.html#recovered_buckets">#</a>recovered_buckets</dt>
<dd>

<p>Number of successfully recovered buckets.</p>

</dd>
<dt id="failed_keys"><a class="permalink" href="GDBM_File.html#failed_keys">#</a>failed_keys</dt>
<dd>

<p>Number of keys that failed to be retrieved.</p>

</dd>
<dt id="failed_buckets"><a class="permalink" href="GDBM_File.html#failed_buckets">#</a>failed_buckets</dt>
<dd>

<p>Number of buckets that failed to be retrieved.</p>

</dd>
</dl>

</dd>
</dl>

<h1 id="AVAILABILITY"><a class="permalink" href="GDBM_File.html#AVAILABILITY">#</a>AVAILABILITY</h1>

<p>gdbm is available from any GNU archive. The master site is <code>ftp.gnu.org</code>, but you are strongly urged to use one of the many mirrors. You can obtain a list of mirror sites from <a href="http://www.gnu.org/order/ftp.html">http://www.gnu.org/order/ftp.html</a>.</p>

<h1 id="SECURITY-AND-PORTABILITY"><a class="permalink" href="GDBM_File.html#SECURITY-AND-PORTABILITY">#</a><a id="SECURITY"></a>SECURITY AND PORTABILITY</h1>

<p><b>Do not accept GDBM files from untrusted sources.</b></p>

<p>GDBM files are not portable across platforms.</p>

<p>The GDBM documentation doesn&#39;t imply that files from untrusted sources can be safely used with <code>libgdbm</code>.</p>

<p>A maliciously crafted file might cause perl to crash or even expose a security vulnerability.</p>

<h1 id="SEE-ALSO"><a class="permalink" href="GDBM_File.html#SEE-ALSO">#</a><a id="SEE"></a>SEE ALSO</h1>

<p><a href="http://man.he.net/man1/perl">perl(1)</a>, <a href="http://man.he.net/man3/DB_File">DB_File(3)</a>, <a href="perldbmfilter.html">perldbmfilter</a>, <a href="http://man.he.net/man3/gdbm">gdbm(3)</a>, <a href="https://www.gnu.org.ua/software/gdbm/manual.html">https://www.gnu.org.ua/software/gdbm/manual.html</a>.</p>


      </div>
      <div id="footer">
        <p>Perldoc Browser is maintained by Dan Book (<a href="https://metacpan.org/author/DBOOK">DBOOK</a>). Please contact him via the <a href="https://github.com/Grinnz/perldoc-browser/issues">GitHub issue tracker</a> or <a href="mailto:dbook@cpan.org">email</a> regarding any issues with the site itself, search, or rendering of documentation.</p>

<p>The Perl documentation is maintained by the Perl 5 Porters in the development of Perl. Please contact them via the <a href="https://github.com/Perl/perl5/issues">Perl issue tracker</a>, the <a href="https://lists.perl.org/list/perl5-porters.html">mailing list</a>, or <a href="https://kiwiirc.com/client/irc.perl.org/p5p">IRC</a> to report any issues with the contents or format of the documentation.</p>


      </div>
    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.slim.min.js" integrity="sha512-/DXTXr6nQodMUiq+IUJYCt2PPOUjrHJ9wFrqpJ3XkgPNOZVfMok7cRw6CSxyCQxXn6ozlESsSh1/sMCTF1rL/g==" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.16.1/umd/popper.min.js" integrity="sha512-ubuT8Z88WxezgSqf3RLuNi5lmjstiJcyezx34yIU2gAHonIi27Na7atqzUZCOoY4CExaoFumzOsFQ2Ch+I/HCw==" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js" integrity="sha384-B4gt1jrGC7Jh4AgTPSdUtOBvfO8shuf57BaghqFfPlYxofvL8/KUEfYiJOMMV+rV" crossorigin="anonymous"></script>
    <script src="../highlight.pack.js"></script>
    <script>hljs.highlightAll();</script>
  </body>
</html>
